package cn.doitedu.spring_boot.controller;

import cn.doitedu.spring_boot.beans.User;
import cn.doitedu.spring_boot.beans.UserPar;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Date 22.3.24
 * @Created by HANGGE
 * @Description
 */
@RestController
@RequestMapping("/swagger")
@Api(value = "用户接口", tags = {"用户接口"})
public class MyController {
    @ApiOperation("测试swagger自动生成文档01 ")
    @GetMapping("/test01")
    public  String  test01(){
        return "测试01......" ;
    }

    @ApiOperation("测试swagger自动生成文档02 ")
    @PostMapping("/test02")
    public  String  test02(){
        return "测试02......" ;
    }


    @ApiOperation("通过用户名获取用户信息")
    @PostMapping("/getUserByName")
    public User getUserByName(@ApiParam("用户名") String  name ,@ApiParam("用户密码") String password){
        System.out.println(name +"--"+password);
        return new User() ;
    }

    @ApiOperation("添加用户信息")
    @PostMapping("/addUser")
    public User addUser(UserPar userPar){
        return new User() ;
    }




}
